#pragma once

#include <gofcl_usbfs_deptfstat.h>
#include <gofcl_usbfs_ep_r.h>

typedef struct {
	u32_s fifo_remain_32b_nums : 16;
	u32_s : 16;
} usbfs_deptfstat_expl_s;

_Static_assert(sizeof(usbfs_deptfstat_expl_s) == 4,
	       "Struct usbfs_deptfstat_expl_s defined error!");

static inline usbfs_deptfstat_expl_s usbfs_get_fifo_stat_s(usbfs_ep_re io_r,
							   usbfs_ep_rre ep_rr) {
	union {
		usbfs_deptfstat_expl_s e;
		usbfs_deptfstat_s d;
	} ed = {
		.d = usbfs_rreg_deptfstat_s(io_r, ep_rr),
	};
	return ed.e;
}
